package org.seckill.dto;

/**
 * Created by developer on 17-5-28.
 */
public class SeckillResult<T> {
    //是否秒杀成功
    private boolean success;
    //秒杀成功后的数据
    private T data;
    //错误信息
    private String error;

    //成功的话有数据
    public SeckillResult(boolean success, T data) {
        this.success = success;
        this.data = data;
    }
    //失败的话有报错
    public SeckillResult(boolean success, String error) {
        this.success = success;
        this.error = error;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}
